home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / pandoras.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  17KB  |  529 lines

  1. /***************************************************************************
  2.  
  3. Pandora's Palace(GX328) (c) 1984 Konami/Interlogic
  4.  
  5. Driver by Manuel Abadia <manu@teleline.es>
  6.  
  7. Notes:
  8.     Press 1P and 2P together to enter test mode.
  9.  
  10.     There is an empty space ($4000-$5fff) on the CPU A. That space probably
  11.     is used for debugging purposes on the real thing. The code checks that
  12.     memory location, and if a ROM is present, it starts to execute code from
  13.     that ROM.
  14.  
  15.     The AY-8910 has a timer or something like that on port B. I've managed
  16.     to make it sound, but it's not 100% accurate.
  17.  
  18. ***************************************************************************/
  19.  
  20. #include "driver.h"
  21. #include "cpu/m6809/m6809.h"
  22. #include "cpu/z80/z80.h"
  23. #include "cpu/i8039/i8039.h"
  24. #include "vidhrdw/generic.h"
  25.  
  26. static int irq_enable_a, irq_enable_b;
  27. static int firq_old_data_a, firq_old_data_b;
  28. static int     i8039_irqenable;
  29.  
  30. unsigned char *pandoras_sharedram;
  31. static unsigned char *pandoras_sharedram2;
  32.  
  33. /* from vidhrdw */
  34. void pandoras_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  35. READ_HANDLER( pandoras_vram_r );
  36. READ_HANDLER( pandoras_cram_r );
  37. WRITE_HANDLER( pandoras_vram_w );
  38. WRITE_HANDLER( pandoras_cram_w );
  39. WRITE_HANDLER( pandoras_flipscreen_w );
  40. WRITE_HANDLER( pandoras_scrolly_w );
  41. int pandoras_vh_start(void);
  42. void pandoras_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  43.  
  44. static int pandoras_interrupt_a( void ){
  45.     if (irq_enable_a)
  46.         return M6809_INT_IRQ;
  47.     return ignore_interrupt();
  48. }
  49.  
  50. static int pandoras_interrupt_b( void ){
  51.     if (irq_enable_b)
  52.         return M6809_INT_IRQ;
  53.     return ignore_interrupt();
  54. }
  55.  
  56. static READ_HANDLER( pandoras_sharedram_r ){
  57.     return pandoras_sharedram[offset];
  58. }
  59.  
  60. static WRITE_HANDLER( pandoras_sharedram_w ){
  61.     pandoras_sharedram[offset] = data;
  62. }
  63.  
  64. static READ_HANDLER( pandoras_sharedram2_r ){
  65.     return pandoras_sharedram2[offset];
  66. }
  67.  
  68. static WRITE_HANDLER( pandoras_sharedram2_w ){
  69.     pandoras_sharedram2[offset] = data;
  70. }
  71.  
  72. static WRITE_HANDLER( pandoras_int_control_w ){
  73.     /*    byte 0:    irq enable (CPU A)
  74.         byte 2:    coin counter 1
  75.         byte 3: coin counter 2
  76.         byte 5: flip screen
  77.         byte 6:    irq enable (CPU B)
  78.         byte 7:    NMI to CPU B
  79.  
  80.         other bytes unknown */
  81.  
  82.     switch (offset){
  83.         case 0x00:    if (!data) cpu_set_irq_line(0, M6809_IRQ_LINE, CLEAR_LINE);
  84.                     irq_enable_a = data;
  85.                     break;
  86.         case 0x02:    coin_counter_w(0,data & 0x01);
  87.                     break;
  88.         case 0x03:    coin_counter_w(1,data & 0x01);
  89.                     break;
  90.         case 0x05:    pandoras_flipscreen_w(0, data);
  91.                     break;
  92.         case 0x06:    if (!data) cpu_set_irq_line(1, M6809_IRQ_LINE, CLEAR_LINE);
  93.                     irq_enable_b = data;
  94.                     break;
  95.         case 0x07:    cpu_cause_interrupt(1,M6809_INT_NMI);
  96.                     break;
  97.  
  98.         default:
  99.             logerror("%04x: (irq_ctrl) write %02x to %02x\n",cpu_get_pc(), data, offset);
  100.     }
  101. }
  102.  
  103. WRITE_HANDLER( pandoras_cpua_irqtrigger_w ){
  104.     if (!firq_old_data_a && data){
  105.         cpu_cause_interrupt(0,M6809_INT_FIRQ);
  106.     }
  107.  
  108.     firq_old_data_a = data;
  109. }
  110.  
  111. WRITE_HANDLER( pandoras_cpub_irqtrigger_w ){
  112.     if (!firq_old_data_b && data){
  113.         cpu_cause_interrupt(1,M6809_INT_FIRQ);
  114.     }
  115.  
  116.     firq_old_data_b = data;
  117. }
  118.  
  119. static WRITE_HANDLER( i8039_irqen_w )
  120. {
  121.     /* ??? */
  122.     i8039_irqenable = data & 0x80;
  123. }
  124.  
  125. WRITE_HANDLER( pandoras_z80_irqtrigger_w )
  126. {
  127.     cpu_cause_interrupt(2,0xff);
  128. }
  129.  
  130. WRITE_HANDLER( pandoras_i8039_irqtrigger_w )
  131. {
  132.     if (i8039_irqenable)
  133.         cpu_cause_interrupt(3,I8039_EXT_INT);
  134. }
  135.  
  136. static struct MemoryReadAddress pandoras_readmem_a[] =
  137. {
  138.     { 0x0000, 0x0fff, pandoras_sharedram_r },    /* Work RAM (Shared with CPU B) */
  139.     { 0x1000, 0x13ff, pandoras_cram_r },        /* Color RAM (shared with CPU B) */
  140.     { 0x1400, 0x17ff, pandoras_vram_r },        /* Video RAM (shared with CPU B) */
  141.     { 0x4000, 0x5fff, MRA_ROM },                /* see notes */
  142.     { 0x6000, 0x67ff, pandoras_sharedram2_r },    /* Shared RAM with CPU B */
  143.     { 0x8000, 0xffff, MRA_ROM },                /* ROM */
  144.     { -1 }
  145. };
  146.  
  147. static struct MemoryWriteAddress pandoras_writemem_a[] =
  148. {
  149.     { 0x0000, 0x0fff, pandoras_sharedram_w, &pandoras_sharedram },    /* Work RAM (Shared with CPU B) */
  150.     { 0x1000, 0x13ff, pandoras_cram_w, &colorram },                    /* Color RAM (shared with CPU B) */
  151.     { 0x1400, 0x17ff, pandoras_vram_w, &videoram },                    /* Video RAM (shared with CPU B) */
  152.     { 0x1800, 0x1807, pandoras_int_control_w },                        /* INT control */
  153.     { 0x1a00, 0x1a00, pandoras_scrolly_w },                            /* bg scroll */
  154.     { 0x1c00, 0x1c00, pandoras_z80_irqtrigger_w },                    /* cause INT on the Z80 */
  155.     { 0x1e00, 0x1e00, soundlatch_w },                                /* sound command to the Z80 */
  156.     { 0x2000, 0x2000, pandoras_cpub_irqtrigger_w },                    /* cause FIRQ on CPU B */
  157.     { 0x2001, 0x2001, watchdog_reset_w },                            /* watchdog reset */
  158.     { 0x4000, 0x5fff, MWA_ROM },                                    /* see notes */
  159.     { 0x6000, 0x67ff, pandoras_sharedram2_w, &pandoras_sharedram2 },/* Shared RAM with CPU B */
  160.     { 0x8000, 0xffff, MWA_ROM },                                    /* ROM */
  161.     { -1 }
  162. };
  163.  
  164. static struct MemoryReadAddress pandoras_readmem_b[] =
  165. {
  166.     { 0x0000, 0x0fff, pandoras_sharedram_r },    /* Work RAM (Shared with CPU A) */
  167.     { 0x1000, 0x13ff, pandoras_cram_r },        /* Color RAM (shared with CPU A) */
  168.     { 0x1400, 0x17ff, pandoras_vram_r },        /* Video RAM (shared with CPU A) */
  169.     { 0x1800, 0x1800, input_port_0_r },            /* DIPSW #1 */
  170.     { 0x1c00, 0x1c00, input_port_1_r },            /* DISPW #2 */
  171.     { 0x1a00, 0x1a00, input_port_3_r },            /* COINSW */
  172.     { 0x1a01, 0x1a01, input_port_4_r },            /* 1P inputs */
  173.     { 0x1a02, 0x1a02, input_port_5_r },            /* 2P inputs */
  174.     { 0x1a03, 0x1a03, input_port_2_r },            /* DIPSW #3 */
  175. //    { 0x1e00, 0x1e00, MWA_NOP },                /* ??? */
  176.     { 0xc000, 0xc7ff, pandoras_sharedram2_r },    /* Shared RAM with the CPU A */
  177.     { 0xe000, 0xffff, MRA_ROM },                /* ROM */
  178.     { -1 }
  179. };
  180.  
  181. static struct MemoryWriteAddress pandoras_writemem_b[] =
  182. {
  183.     { 0x0000, 0x0fff, pandoras_sharedram_w },    /* Work RAM (Shared with CPU A) */
  184.     { 0x1000, 0x13ff, pandoras_cram_w },        /* Color RAM (shared with CPU A) */
  185.     { 0x1400, 0x17ff, pandoras_vram_w },        /* Video RAM (shared with CPU A) */
  186.     { 0x1800, 0x1807, pandoras_int_control_w },    /* INT control */
  187.     { 0x8000, 0x8000, watchdog_reset_w },        /* watchdog reset */
  188.     { 0xa000, 0xa000, pandoras_cpua_irqtrigger_w },/* cause FIRQ on CPU A */
  189.     { 0xc000, 0xc7ff, pandoras_sharedram2_w },    /* Shared RAM with the CPU A */
  190.     { 0xe000, 0xffff, MWA_ROM },                /* ROM */
  191.     { -1 }
  192. };
  193.  
  194. static struct MemoryReadAddress pandoras_readmem_snd[] =
  195. {
  196.     { 0x0000, 0x1fff, MRA_ROM },                /* ROM */
  197.     { 0x2000, 0x23ff, MRA_RAM },                /* RAM */
  198.     { 0x4000, 0x4000, soundlatch_r },            /* soundlatch_r */
  199.     { 0x6001, 0x6001, AY8910_read_port_0_r },    /* AY-8910 */
  200.     { -1 }
  201. };
  202.  
  203. static struct MemoryWriteAddress pandoras_writemem_snd[] =
  204. {
  205.     { 0x0000, 0x1fff, MWA_ROM },                /* ROM */
  206.     { 0x2000, 0x23ff, MWA_RAM },                /* RAM */
  207.     { 0x6000, 0x6000, AY8910_control_port_0_w },/* AY-8910 */
  208.     { 0x6002, 0x6002, AY8910_write_port_0_w },    /* AY-8910 */
  209.     { 0x8000, 0x8000, pandoras_i8039_irqtrigger_w },/* cause INT on the 8039 */
  210.     { 0xa000, 0xa000, soundlatch2_w },            /* sound command to the 8039 */
  211.     { -1 }
  212. };
  213.  
  214. static struct MemoryReadAddress i8039_readmem[] =
  215. {
  216.     { 0x0000, 0x0fff, MRA_ROM },
  217.     { -1 }
  218. };
  219.  
  220. static struct MemoryWriteAddress i8039_writemem[] =
  221. {
  222.     { 0x0000, 0x0fff, MWA_ROM },
  223.     { -1 }
  224. };
  225.  
  226. static struct IOReadPort i8039_readport[] =
  227. {
  228.     { 0x00, 0xff, soundlatch2_r },
  229.     { -1 }
  230. };
  231.  
  232. static struct IOWritePort i8039_writeport[] =
  233. {
  234.     { I8039_p1, I8039_p1, DAC_0_data_w },
  235.     { I8039_p2, I8039_p2, i8039_irqen_w },
  236.     { -1 }
  237. };
  238.  
  239. /***************************************************************************
  240.  
  241.     Input Ports
  242.  
  243. ***************************************************************************/
  244.  
  245. INPUT_PORTS_START( pandoras )
  246.     PORT_START    /* DSW #1 */
  247.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  248.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  249.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  250.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  251.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  252.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  253.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  254.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  255.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  256.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  257.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  258.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  259.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  260.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  261.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  262.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  263.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  264.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  265.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  266.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  267.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  268.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  269.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  270.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  271.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  272.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  273.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  274.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  275.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  276.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  277.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  278.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  279.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  280. //    PORT_DIPSETTING(    0x00, "Invalid" )
  281.  
  282.     PORT_START    /* DSW #2 */
  283.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  284.     PORT_DIPSETTING(    0x03, "3" )
  285.     PORT_DIPSETTING(    0x02, "4" )
  286.     PORT_DIPSETTING(    0x01, "5" )
  287.     PORT_DIPSETTING(    0x00, "7" )
  288.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  289.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  290.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  291.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  292.     PORT_DIPSETTING(    0x18, "20k and every 60k" )
  293.     PORT_DIPSETTING(    0x10, "30k and every 70k" )
  294.     PORT_DIPSETTING(    0x08, "20k" )
  295.     PORT_DIPSETTING(    0x00, "30k" )
  296.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  297.     PORT_DIPSETTING(    0x60, "Easy" )
  298.     PORT_DIPSETTING(    0x40, "Normal" )
  299.     PORT_DIPSETTING(    0x20, "Difficult" )
  300.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  301.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  302.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  303.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  304.  
  305.     PORT_START    /* DSW #3 */
  306.     PORT_DIPNAME( 0x01, 0x01, "Freeze" )
  307.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  308.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  309.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  310.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  311.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  312.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  313.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  314.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  315.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  316.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  317.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  318.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  319.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  320.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  321.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  322.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  323.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  324.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  325.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  326.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  327.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  328.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  329.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  330.  
  331.     PORT_START    /* COINSW */
  332.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  333.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  334.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  335.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  336.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  337.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  338.     PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
  339.  
  340.     PORT_START    /* PLAYER 1 INPUTS */
  341.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  342.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  343.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  344.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  345.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  346.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
  347.  
  348.     PORT_START    /* PLAYER 2 INPUTS */
  349.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  350.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  351.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  352.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  353.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  354.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
  355.  
  356. INPUT_PORTS_END
  357.  
  358. static struct GfxLayout charlayout =
  359. {
  360.     8,8,            /* 8*8 characters */
  361.     0x4000/32,        /* 512 characters */
  362.     4,                /* 4bpp */
  363.     { 0, 1, 2, 3 },    /* the four bitplanes are packed in one nibble */
  364.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
  365.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  366.     32*8            /* every character takes 32 consecutive bytes */
  367. };
  368.  
  369. static struct GfxLayout spritelayout =
  370. {
  371.     16,16,            /* 16*16 sprites */
  372.     0x6000/128,        /* 192 sprites */
  373.     4,                /* 4 bpp */
  374.     { 0, 1, 2, 3 }, /* the four bitplanes are packed in one nibble */
  375.     { 15*4, 14*4, 13*4, 12*4, 11*4, 10*4, 9*4, 8*4,
  376.             7*4, 6*4, 5*4, 4*4, 3*4, 2*4, 1*4, 0*4 },
  377.     { 15*4*16, 14*4*16, 13*4*16, 12*4*16, 11*4*16, 10*4*16, 9*4*16, 8*4*16,
  378.             7*4*16, 6*4*16, 5*4*16, 4*4*16, 3*4*16, 2*4*16, 1*4*16, 0*4*16 },
  379.     32*4*8            /* every sprite takes 128 consecutive bytes */
  380. };
  381.  
  382. static struct GfxDecodeInfo gfxdecodeinfo[] =
  383. {
  384.     { REGION_GFX1, 0, &charlayout,       0, 16 },
  385.     { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
  386.     { -1 } /* end of array */
  387. };
  388.  
  389. /***************************************************************************
  390.  
  391.     Machine Driver
  392.  
  393. ***************************************************************************/
  394.  
  395. static void pandoras_init_machine( void )
  396. {
  397.     firq_old_data_a = firq_old_data_b = 0;
  398.     irq_enable_a = irq_enable_b = 0;
  399. }
  400.  
  401. static READ_HANDLER( pandoras_portB_r )
  402. {
  403.     /* ??? */
  404.     return (cpu_gettotalcycles() / 1024) & 0x0f;
  405. }
  406.  
  407. static WRITE_HANDLER( pandoras_portB_w )
  408. {
  409.     /* ??? */
  410. }
  411.  
  412. static struct AY8910interface ay8910_interface =
  413. {
  414.     1,            /* 1 chip */
  415.     4000000,    /* ??????? */
  416.     { 25 },
  417.     { 0 },
  418.     { pandoras_portB_r },
  419.     { 0 },
  420.     { pandoras_portB_w }
  421. };
  422.  
  423. static struct DACinterface dac_interface =
  424. {
  425.     1,
  426.     { 50 }
  427. };
  428.  
  429. static struct MachineDriver machine_driver_pandoras =
  430. {
  431.     /* basic machine hardware */
  432.     {
  433.         {
  434.             CPU_M6809,        /* CPU A */
  435.             3000000,        /* ? */
  436.             pandoras_readmem_a,pandoras_writemem_a,0,0,
  437.             pandoras_interrupt_a,1,
  438.         },
  439.         {
  440.             CPU_M6809,        /* CPU B */
  441.             3000000,        /* ? */
  442.             pandoras_readmem_b,pandoras_writemem_b,0,0,
  443.             pandoras_interrupt_b,1,
  444.         },
  445.         {
  446.             CPU_Z80 | CPU_AUDIO_CPU,
  447.             3579545,        /* ? */
  448.             pandoras_readmem_snd,pandoras_writemem_snd,0,0,
  449.             ignore_interrupt,1
  450.         },
  451.         {
  452.             CPU_I8039 | CPU_AUDIO_CPU,
  453.             8000000/15,        /* ? */
  454.             i8039_readmem,i8039_writemem,i8039_readport,i8039_writeport,
  455.             ignore_interrupt,1
  456.         },
  457.     },
  458.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  459.     50,    /* slices per frame */
  460.     pandoras_init_machine,
  461.  
  462.     /* video hardware */
  463.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  464.     gfxdecodeinfo,
  465.     32, 16*16+16*16,
  466.     pandoras_vh_convert_color_prom,
  467.  
  468.     VIDEO_TYPE_RASTER,
  469.     0,
  470.     pandoras_vh_start,
  471.     0,
  472.     pandoras_vh_screenrefresh,
  473.  
  474.     /* sound hardware */
  475.     0,0,0,0,
  476.     {
  477.         {
  478.             SOUND_AY8910,
  479.             &ay8910_interface
  480.         },
  481.         {
  482.             SOUND_DAC,
  483.             &dac_interface
  484.         }
  485.     }
  486. };
  487.  
  488.  
  489. /***************************************************************************
  490.  
  491.   Game ROMs
  492.  
  493. ***************************************************************************/
  494.  
  495. ROM_START( pandoras )
  496.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64K for the CPU A */
  497.     ROM_LOAD( "pand_j13.cpu",    0x08000, 0x02000, 0x7a0fe9c5 )
  498.     ROM_LOAD( "pand_j12.cpu",    0x0a000, 0x02000, 0x7dc4bfe1 )
  499.     ROM_LOAD( "pand_j10.cpu",    0x0c000, 0x02000, 0xbe3af3b7 )
  500.     ROM_LOAD( "pand_j9.cpu",    0x0e000, 0x02000, 0xe674a17a )
  501.  
  502.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64K for the CPU B */
  503.     ROM_LOAD( "pand_j5.cpu",    0x0e000, 0x02000, 0x4aab190b )
  504.  
  505.     ROM_REGION( 0x10000, REGION_CPU3 ) /* 64K for the Sound CPU */
  506.     ROM_LOAD( "pand_6c.snd",    0x00000, 0x02000, 0x0c1f109d )
  507.  
  508.     ROM_REGION( 0x1000, REGION_CPU4 ) /* 4K for the Sound CPU 2 */
  509.     ROM_LOAD( "pand_7e.snd",    0x00000, 0x01000, 0x18b0f9d0 )
  510.  
  511.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  512.     ROM_LOAD( "pand_a18.cpu",    0x00000, 0x02000, 0x23706d4a )    /* tiles */
  513.     ROM_LOAD( "pand_a19.cpu",    0x02000, 0x02000, 0xa463b3f9 )
  514.  
  515.     ROM_REGION( 0x6000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  516.     ROM_LOAD( "pand_j18.cpu",    0x00000, 0x02000, 0x99a696c5 )    /* sprites */
  517.     ROM_LOAD( "pand_j17.cpu",    0x02000, 0x02000, 0x38a03c21 )
  518.     ROM_LOAD( "pand_j16.cpu",    0x04000, 0x02000, 0xe0708a78 )
  519.  
  520.     ROM_REGION( 0x0220, REGION_PROMS )
  521.     ROM_LOAD( "pandora.2a",        0x0000, 0x020, 0x4d56f939 ) /* palette */
  522.     ROM_LOAD( "pandora.17g",    0x0020, 0x100, 0xc1a90cfc ) /* sprite lookup table */
  523.     ROM_LOAD( "pandora.16b",    0x0120, 0x100, 0xc89af0c3 ) /* character lookup table */
  524. ROM_END
  525.  
  526.  
  527.  
  528. GAME( 1984, pandoras, 0, pandoras, pandoras, 0, ROT90, "Konami/Interlogic", "Pandora's Palace" )
  529.